#include "bridge_motors.h"
#include "driver/gpio.h"

/*初始化GPIO,接收数组参数*/
int device_hb_gpio_init(int *io_num)
{
    gpio_config_t io_conf = {};
    io_conf.mode = GPIO_MODE_OUTPUT;
    io_conf.pin_bit_mask = ((1ULL<<io_num[0])|(1ULL<<io_num[1]));
    io_conf.pull_down_en = 0;
    io_conf.pull_up_en = 0;
    gpio_config(&io_conf);
    return 0;
}

int device_hb_gpio_set(int io_num, bool state)
{
    gpio_set_level(io_num, state);
    printf("set gpio %d state %d\n", io_num, state);
    return 0;
}